﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ADShop.Models;
namespace ADShop.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/
        #region "Variable"
        //ADShopEntities adshop = new ADShopEntities();
        EShopEntities1 adshop = new EShopEntities1();
        #endregion
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult SearchQuery(string id)
        {
            var Result = adshop.Product.Where(d => d.NameProduct.Contains(id)).ToList();
            ViewBag.Cout = Result.Count;
            ViewBag.Query = id;
            return View(Result);
        }

    }
}
